package com.burst.reptile.framework.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 读取项目相关配置
 * 
 * @author wujin
 * @date: 2020年5月21日 下午3:26:14
 */
@Component
@ConfigurationProperties(prefix = "crawler")
public class CrawlerConfig {

	/** 项目名称 */
	private String name;

	/** 版本 */
	private String version;

	/** 版权年份 */
	private String copyrightYear;

	/** 获取地址开关 */
	private static boolean addressEnabled;

	/** 上传路径 */
	private static String profile;

	/** 腾讯云 secretId */
	private static String secretId;

	/** 腾讯云 secretKey */
	private static String secretKey;

	/** ffmpegPath ffmpeg.exe的路径 */
	private static String ffmpegPath;

	/** 水印图片的路径 */
	private static String pressImgFile;

	/**
	 * 存储桶名称
	 */
	private static String bucketName;

	/**
	 * 域名
	 */
	private static String domainName;

	/**
	 * 是否添加水印
	 */
	private static boolean watermark;

	/**
	 * 站点初始化
	 */
	private static boolean cityinit;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getCopyrightYear() {
		return copyrightYear;
	}

	public void setCopyrightYear(String copyrightYear) {
		this.copyrightYear = copyrightYear;
	}

	public static boolean getAddressEnabled() {
		return addressEnabled;
	}

	public void setAddressEnabled(boolean addressEnabled) {
		CrawlerConfig.addressEnabled = addressEnabled;
	}

	public static String getProfile() {
		return profile;
	}

	public void setProfile(String profile) {
		CrawlerConfig.profile = profile;
	}

	public static String getSecretId() {
		return secretId;
	}

	public void setSecretId(String secretId) {
		CrawlerConfig.secretId = secretId;
	}

	public static String getSecretKey() {
		return secretKey;
	}

	public void setSecretKey(String secretKey) {
		CrawlerConfig.secretKey = secretKey;
	}

	public static String getFfmpegPath() {
		return ffmpegPath;
	}

	public void setFfmpegPath(String ffmpegPath) {
		CrawlerConfig.ffmpegPath = ffmpegPath;
	}

	public static String getBucketName() {
		return bucketName;
	}

	public void setBucketName(String bucketName) {
		CrawlerConfig.bucketName = bucketName;
	}

	public static String getDomainName() {
		return domainName;
	}

	public void setDomainName(String domainName) {
		CrawlerConfig.domainName = domainName;
	}

	public static String getPressImgFile() {
		return pressImgFile;
	}

	public void setPressImgFile(String pressImgFile) {
		CrawlerConfig.pressImgFile = pressImgFile;
	}

	public static boolean getWatermark() {
		return watermark;
	}

	public void setWatermark(boolean watermark) {
		CrawlerConfig.watermark = watermark;
	}

	public static boolean getCityinit() {
		return cityinit;
	}

	public void setCityinit(boolean cityinit) {
		CrawlerConfig.cityinit = cityinit;
	}

	/**
	 * 获取头像上传路径
	 */
	public static String getAvatarPath() {
		return getProfile() + "/avatar";
	}

	/**
	 * 获取下载路径
	 */
	public static String getDownloadPath() {
		return getProfile() + "/download/";
	}

	/**
	 * 获取上传路径
	 */
	public static String getUploadPath() {
		return getProfile() + "/upload";
	}

	/**
	 * 视频封面地址
	 */
	public static String getImgCoverPath() {
		return getProfile() + "/cover";
	}

}
